<?php Pants::partial('includes/header'); ?>

<?php
$today       = date('Y-m-d'); 
$newComments = array();
$oldComments = array();

foreach($comments as $comment) {
  if (date('Y-m-d', $comment->posted) == $today) {
    $newComments[] = $comment;
  } else {
    $oldComments[] = $comment;
  }
}
?>

<h3>Today's Comments</h3>

<?php if (count($newComments)): ?>
  <ul class="slick">
    <?php foreach($newComments as $comment): ?>
      <?php Pants::partial('includes/comment/'.$mode, array('comment' => $comment)); ?>
    <?php endforeach; ?>
  </ul>
<?php else: ?>
  <p>No comments have been posted today.</p>
<?php endif; ?>

<h3>Ancient History</h3>

<?php if (count($oldComments)): ?>
  <ul class="slick">
    <?php foreach($oldComments as $comment): ?>
      <?php Pants::partial('includes/comment/'.$mode, array('comment' => $comment)); ?>
    <?php endforeach; ?>
  </ul>
<?php else: ?>
  <p>Things have been very quiet.</p>
<?php endif; ?>

<?php Pants::partial('includes/footer'); ?>
